package com.daxia.test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Hi implements Serializable {
    public static void main(String[] args) throws Exception {
        String dir = "/Users/kevin/Documents/code/illuminairy-parser/src/main/java/com/illuminairy/entity/";
        File[] files = new File(dir).listFiles();
        for (File file : files) {
            BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
            String line = null;
            List<String> list = new ArrayList<String>();
            while ((line = reader.readLine()) != null) {
                if (line.contains("以下模式片段")
                        || line.contains("类")
                        || line.contains("获取")
                        || line.contains("设置")) {
                    
                } else {
                list.add(line);
                }
            }
            
            FileWriter writer = new FileWriter(file);
            for (String string : list) {
                writer.write(string);
                writer.write("\n");
            }
            writer.close();
        }
    }
}
